﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Sheet Appearance</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    
    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
            var spreadNS = GcSpread.Sheets;
            var sheet = spread.getSheet(0);
            sheet.isPaintSuspended(true);
            var lineBorder1 = new spreadNS.LineBorder("red", spreadNS.LineStyle.double);
            var range1 = new spreadNS.Range(2, 2, 4, 4);
            sheet.setBorder(range1, lineBorder1, { left: true, right: true, top: true, bottom: true });

            var lineBorder2 = new spreadNS.LineBorder("green", spreadNS.LineStyle.thin);
            var range2 = new spreadNS.Range(5, 5, 3, 3);
            sheet.setBorder(range2, lineBorder2, { left: true, right: true, top: true, bottom: true });
            sheet.isPaintSuspended(false);

            $("#chkVisible").click(function () {
                var sheet = spread.getActiveSheet();

                if (sheet) {
                    sheet.visible($(this).prop("checked"));

                    spread.invalidateLayout();
                    spread.repaint();
                }
            });

            $("#zoomFactor").change(function () {
                var sheet = spread.getActiveSheet();

                if (sheet) {
                    var zoomFactor = parseInt($(this).val());
                    sheet.zoom(zoomFactor);
                }
            });
        });
    /*code_end*/
    </script>
</head>
<body>
    <div class="sample-turtorial">
        <div id="ss" style="width:100%; height:415px;border: 1px solid gray;"></div>
        <div class="demo-options">
            <div class="option-row">
                <input type="checkbox" id="chkVisible" checked />
                <label for="chkVisible">Sheet Visible</label>
            </div>
            <div class="option-row">
                <label >Zoom:</label>
                <input id="zoomFactor" type="range" name="points" min="0" max="4" value="1" />
            </div>
        </div>
    </div>
</body>
</html>